package com.open.capacity.workflow3.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.open.capacity.reimburse.util.uuid.UUIDUtils;
import com.open.capacity.workflow3.engine.NwfUserInfo;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author
 * @email
 * @date 2023-11-02 21:21:15
 */

@Data
public class NwfTask implements Serializable {
    private static final long serialVersionUID = 1L;


    private String id;

    private String companyId;

    private String departmentId;

    private String processId;

    private String nodeId;

    private String nodeName;

    private Integer taskType;

    private Integer timeoutAction;

    private Integer timeoutNotice;

    private Integer timeoutInterval;

    private String timeoutStrategy;

    private String prevNodeId;

    private String prevNodeName;

    private Integer isFinished;

    private Integer isUrge;

    private String firstUserid;

    private String childProcessId;

    private Integer isBatchAudit;

    private String createUserid;

    private String createUsername;

    @JsonFormat(timezone="GMT+8",pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    private String updateUserid;

    private String updateUsername;

    private Date updateTime;

    public List<NwfUserInfo> userInfoList;

    public NwfTask create() {
        id = UUIDUtils.getOriginalUUIDWithoutBar();
        isFinished = 0;
        isUrge = 0;
        createTime = new Date();
        return this;
    }

}
